package com.wwwzh.himalayafm.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.wwwzh.himalayafm.fragment.down.PagerDownFragment;

import java.util.List;

/**
 * Created by wuruyuan on 2016/12/2.
 */

public class PagerDownAdapter extends FragmentPagerAdapter {
   private List<String> list;

    public PagerDownAdapter(FragmentManager fm, List<String> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return PagerDownFragment.getInstance(list.get(position));
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
